<?php


abstract class BaseReleasePeer {

	
	const DATABASE_NAME = 'propel';

	
	const TABLE_NAME = 'release';

	
	const CLASS_DEFAULT = 'lib.model.Release';

	
	const NUM_COLUMNS = 13;

	
	const NUM_LAZY_LOAD_COLUMNS = 0;


	
	const ID = 'release.ID';

	
	const NOMBRE = 'release.NOMBRE';

	
	const VIDEO_ID = 'release.VIDEO_ID';

	
	const SUBTITULOS_COLOREADOS = 'release.SUBTITULOS_COLOREADOS';

	
	const CODEC_VIDEO_ID = 'release.CODEC_VIDEO_ID';

	
	const CODEC_AUDIO_ID = 'release.CODEC_AUDIO_ID';

	
	const CONTENEDOR_ID = 'release.CONTENEDOR_ID';

	
	const RESOLUCION = 'release.RESOLUCION';

	
	const FUENTE_VIDEO_ID = 'release.FUENTE_VIDEO_ID';

	
	const CENSURADO = 'release.CENSURADO';

	
	const RECOMENDADO = 'release.RECOMENDADO';

	
	const INSERTADO = 'release.INSERTADO';

	
	const FINALIZADO = 'release.FINALIZADO';

	
	private static $phpNameMap = null;


	
	private static $fieldNames = array (
		BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'VideoId', 'SubtitulosColoreados', 'CodecVideoId', 'CodecAudioId', 'ContenedorId', 'Resolucion', 'FuenteVideoId', 'Censurado', 'Recomendado', 'Insertado', 'Finalizado', ),
		BasePeer::TYPE_COLNAME => array (ReleasePeer::ID, ReleasePeer::NOMBRE, ReleasePeer::VIDEO_ID, ReleasePeer::SUBTITULOS_COLOREADOS, ReleasePeer::CODEC_VIDEO_ID, ReleasePeer::CODEC_AUDIO_ID, ReleasePeer::CONTENEDOR_ID, ReleasePeer::RESOLUCION, ReleasePeer::FUENTE_VIDEO_ID, ReleasePeer::CENSURADO, ReleasePeer::RECOMENDADO, ReleasePeer::INSERTADO, ReleasePeer::FINALIZADO, ),
		BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'video_id', 'subtitulos_coloreados', 'codec_video_id', 'codec_audio_id', 'contenedor_id', 'resolucion', 'fuente_video_id', 'censurado', 'recomendado', 'insertado', 'finalizado', ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
	);

	
	private static $fieldKeys = array (
		BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'VideoId' => 2, 'SubtitulosColoreados' => 3, 'CodecVideoId' => 4, 'CodecAudioId' => 5, 'ContenedorId' => 6, 'Resolucion' => 7, 'FuenteVideoId' => 8, 'Censurado' => 9, 'Recomendado' => 10, 'Insertado' => 11, 'Finalizado' => 12, ),
		BasePeer::TYPE_COLNAME => array (ReleasePeer::ID => 0, ReleasePeer::NOMBRE => 1, ReleasePeer::VIDEO_ID => 2, ReleasePeer::SUBTITULOS_COLOREADOS => 3, ReleasePeer::CODEC_VIDEO_ID => 4, ReleasePeer::CODEC_AUDIO_ID => 5, ReleasePeer::CONTENEDOR_ID => 6, ReleasePeer::RESOLUCION => 7, ReleasePeer::FUENTE_VIDEO_ID => 8, ReleasePeer::CENSURADO => 9, ReleasePeer::RECOMENDADO => 10, ReleasePeer::INSERTADO => 11, ReleasePeer::FINALIZADO => 12, ),
		BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'video_id' => 2, 'subtitulos_coloreados' => 3, 'codec_video_id' => 4, 'codec_audio_id' => 5, 'contenedor_id' => 6, 'resolucion' => 7, 'fuente_video_id' => 8, 'censurado' => 9, 'recomendado' => 10, 'insertado' => 11, 'finalizado' => 12, ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
	);

	
	public static function getMapBuilder()
	{
		return BasePeer::getMapBuilder('lib.model.map.ReleaseMapBuilder');
	}
	
	public static function getPhpNameMap()
	{
		if (self::$phpNameMap === null) {
			$map = ReleasePeer::getTableMap();
			$columns = $map->getColumns();
			$nameMap = array();
			foreach ($columns as $column) {
				$nameMap[$column->getPhpName()] = $column->getColumnName();
			}
			self::$phpNameMap = $nameMap;
		}
		return self::$phpNameMap;
	}
	
	static public function translateFieldName($name, $fromType, $toType)
	{
		$toNames = self::getFieldNames($toType);
		$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
		if ($key === null) {
			throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
		}
		return $toNames[$key];
	}

	

	static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
	{
		if (!array_key_exists($type, self::$fieldNames)) {
			throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
		}
		return self::$fieldNames[$type];
	}

	
	public static function alias($alias, $column)
	{
		return str_replace(ReleasePeer::TABLE_NAME.'.', $alias.'.', $column);
	}

	
	public static function addSelectColumns(Criteria $criteria)
	{

		$criteria->addSelectColumn(ReleasePeer::ID);

		$criteria->addSelectColumn(ReleasePeer::NOMBRE);

		$criteria->addSelectColumn(ReleasePeer::VIDEO_ID);

		$criteria->addSelectColumn(ReleasePeer::SUBTITULOS_COLOREADOS);

		$criteria->addSelectColumn(ReleasePeer::CODEC_VIDEO_ID);

		$criteria->addSelectColumn(ReleasePeer::CODEC_AUDIO_ID);

		$criteria->addSelectColumn(ReleasePeer::CONTENEDOR_ID);

		$criteria->addSelectColumn(ReleasePeer::RESOLUCION);

		$criteria->addSelectColumn(ReleasePeer::FUENTE_VIDEO_ID);

		$criteria->addSelectColumn(ReleasePeer::CENSURADO);

		$criteria->addSelectColumn(ReleasePeer::RECOMENDADO);

		$criteria->addSelectColumn(ReleasePeer::INSERTADO);

		$criteria->addSelectColumn(ReleasePeer::FINALIZADO);

	}

	const COUNT = 'COUNT(release.ID)';
	const COUNT_DISTINCT = 'COUNT(DISTINCT release.ID)';

	
	public static function doCount(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}
	
	public static function doSelectOne(Criteria $criteria, $con = null)
	{
		$critcopy = clone $criteria;
		$critcopy->setLimit(1);
		$objects = ReleasePeer::doSelect($critcopy, $con);
		if ($objects) {
			return $objects[0];
		}
		return null;
	}
	
	public static function doSelect(Criteria $criteria, $con = null)
	{
		return ReleasePeer::populateObjects(ReleasePeer::doSelectRS($criteria, $con));
	}
	
	public static function doSelectRS(Criteria $criteria, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if (!$criteria->getSelectColumns()) {
			$criteria = clone $criteria;
			ReleasePeer::addSelectColumns($criteria);
		}

				$criteria->setDbName(self::DATABASE_NAME);

						return BasePeer::doSelect($criteria, $con);
	}
	
	public static function populateObjects(ResultSet $rs)
	{
		$results = array();
	
				$cls = ReleasePeer::getOMClass();
		$cls = sfPropel::import($cls);
				while($rs->next()) {
		
			$obj = new $cls();
			$obj->hydrate($rs);
			$results[] = $obj;
			
		}
		return $results;
	}

	
	public static function doCountJoinVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinCodecVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinCodecAudio(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinContenedor(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinFuenteVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		VideoPeer::addSelectColumns($c);

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = VideoPeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRelease($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinCodecVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		CodecVideoPeer::addSelectColumns($c);

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = CodecVideoPeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getCodecVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRelease($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinCodecAudio(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		CodecAudioPeer::addSelectColumns($c);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = CodecAudioPeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getCodecAudio(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRelease($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinContenedor(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		ContenedorPeer::addSelectColumns($c);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = ContenedorPeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getContenedor(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRelease($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinFuenteVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
		FuenteVideoPeer::addSelectColumns($c);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);
		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = FuenteVideoPeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol);

			$newObject = true;
			foreach($results as $temp_obj1) {
				$temp_obj2 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
										$temp_obj2->addRelease($obj1); 					break;
				}
			}
			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1); 			}
			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
	{
		$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinAll(Criteria $c, $con = null)
	{
		$c = clone $c;

				if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		VideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + VideoPeer::NUM_COLUMNS;

		CodecVideoPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecVideoPeer::NUM_COLUMNS;

		CodecAudioPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + CodecAudioPeer::NUM_COLUMNS;

		ContenedorPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + ContenedorPeer::NUM_COLUMNS;

		FuenteVideoPeer::addSelectColumns($c);
		$startcol7 = $startcol6 + FuenteVideoPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);


					
			$omClass = VideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2 = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}


					
			$omClass = CodecVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3 = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecVideo(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}


					
			$omClass = CodecAudioPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4 = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getCodecAudio(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}


					
			$omClass = ContenedorPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5 = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getContenedor(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}


					
			$omClass = FuenteVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj6 = new $cls();
			$obj6->hydrate($rs, $startcol6);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj6 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
					$newObject = false;
					$temp_obj6->addRelease($obj1); 					break;
				}
			}

			if ($newObject) {
				$obj6->initReleases();
				$obj6->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doCountJoinAllExceptVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinAllExceptCodecVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinAllExceptCodecAudio(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinAllExceptContenedor(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$criteria->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doCountJoinAllExceptFuenteVideo(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ReleasePeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ReleasePeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$criteria->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$criteria->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$criteria->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$rs = ReleasePeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}


	
	public static function doSelectJoinAllExceptVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		CodecVideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + CodecVideoPeer::NUM_COLUMNS;

		CodecAudioPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecAudioPeer::NUM_COLUMNS;

		ContenedorPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + ContenedorPeer::NUM_COLUMNS;

		FuenteVideoPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + FuenteVideoPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = CodecVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getCodecVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}

			$omClass = CodecAudioPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3  = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecAudio(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}

			$omClass = ContenedorPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4  = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getContenedor(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}

			$omClass = FuenteVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5  = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinAllExceptCodecVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		VideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + VideoPeer::NUM_COLUMNS;

		CodecAudioPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecAudioPeer::NUM_COLUMNS;

		ContenedorPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + ContenedorPeer::NUM_COLUMNS;

		FuenteVideoPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + FuenteVideoPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = VideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}

			$omClass = CodecAudioPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3  = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecAudio(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}

			$omClass = ContenedorPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4  = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getContenedor(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}

			$omClass = FuenteVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5  = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinAllExceptCodecAudio(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		VideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + VideoPeer::NUM_COLUMNS;

		CodecVideoPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecVideoPeer::NUM_COLUMNS;

		ContenedorPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + ContenedorPeer::NUM_COLUMNS;

		FuenteVideoPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + FuenteVideoPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = VideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}

			$omClass = CodecVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3  = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecVideo(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}

			$omClass = ContenedorPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4  = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getContenedor(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}

			$omClass = FuenteVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5  = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinAllExceptContenedor(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		VideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + VideoPeer::NUM_COLUMNS;

		CodecVideoPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecVideoPeer::NUM_COLUMNS;

		CodecAudioPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + CodecAudioPeer::NUM_COLUMNS;

		FuenteVideoPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + FuenteVideoPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$c->addJoin(ReleasePeer::FUENTE_VIDEO_ID, FuenteVideoPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = VideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}

			$omClass = CodecVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3  = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecVideo(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}

			$omClass = CodecAudioPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4  = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getCodecAudio(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}

			$omClass = FuenteVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5  = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getFuenteVideo(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


	
	public static function doSelectJoinAllExceptFuenteVideo(Criteria $c, $con = null)
	{
		$c = clone $c;

								if ($c->getDbName() == Propel::getDefaultDB()) {
			$c->setDbName(self::DATABASE_NAME);
		}

		ReleasePeer::addSelectColumns($c);
		$startcol2 = (ReleasePeer::NUM_COLUMNS - ReleasePeer::NUM_LAZY_LOAD_COLUMNS) + 1;

		VideoPeer::addSelectColumns($c);
		$startcol3 = $startcol2 + VideoPeer::NUM_COLUMNS;

		CodecVideoPeer::addSelectColumns($c);
		$startcol4 = $startcol3 + CodecVideoPeer::NUM_COLUMNS;

		CodecAudioPeer::addSelectColumns($c);
		$startcol5 = $startcol4 + CodecAudioPeer::NUM_COLUMNS;

		ContenedorPeer::addSelectColumns($c);
		$startcol6 = $startcol5 + ContenedorPeer::NUM_COLUMNS;

		$c->addJoin(ReleasePeer::VIDEO_ID, VideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_VIDEO_ID, CodecVideoPeer::ID);

		$c->addJoin(ReleasePeer::CODEC_AUDIO_ID, CodecAudioPeer::ID);

		$c->addJoin(ReleasePeer::CONTENEDOR_ID, ContenedorPeer::ID);


		$rs = BasePeer::doSelect($c, $con);
		$results = array();

		while($rs->next()) {

			$omClass = ReleasePeer::getOMClass();

			$cls = sfPropel::import($omClass);
			$obj1 = new $cls();
			$obj1->hydrate($rs);

			$omClass = VideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj2  = new $cls();
			$obj2->hydrate($rs, $startcol2);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj2 = $temp_obj1->getVideo(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
					$newObject = false;
					$temp_obj2->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj2->initReleases();
				$obj2->addRelease($obj1);
			}

			$omClass = CodecVideoPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj3  = new $cls();
			$obj3->hydrate($rs, $startcol3);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj3 = $temp_obj1->getCodecVideo(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
					$newObject = false;
					$temp_obj3->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj3->initReleases();
				$obj3->addRelease($obj1);
			}

			$omClass = CodecAudioPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj4  = new $cls();
			$obj4->hydrate($rs, $startcol4);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj4 = $temp_obj1->getCodecAudio(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
					$newObject = false;
					$temp_obj4->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj4->initReleases();
				$obj4->addRelease($obj1);
			}

			$omClass = ContenedorPeer::getOMClass();


			$cls = sfPropel::import($omClass);
			$obj5  = new $cls();
			$obj5->hydrate($rs, $startcol5);

			$newObject = true;
			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
				$temp_obj1 = $results[$j];
				$temp_obj5 = $temp_obj1->getContenedor(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
					$newObject = false;
					$temp_obj5->addRelease($obj1);
					break;
				}
			}

			if ($newObject) {
				$obj5->initReleases();
				$obj5->addRelease($obj1);
			}

			$results[] = $obj1;
		}
		return $results;
	}


  static public function getUniqueColumnNames()
  {
    return array();
  }
	
	public static function getTableMap()
	{
		return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
	}

	
	public static function getOMClass()
	{
		return ReleasePeer::CLASS_DEFAULT;
	}

	
	public static function doInsert($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} else {
			$criteria = $values->buildCriteria(); 		}

		$criteria->remove(ReleasePeer::ID); 

				$criteria->setDbName(self::DATABASE_NAME);

		try {
									$con->begin();
			$pk = BasePeer::doInsert($criteria, $con);
			$con->commit();
		} catch(PropelException $e) {
			$con->rollback();
			throw $e;
		}

		return $pk;
	}

	
	public static function doUpdate($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$selectCriteria = new Criteria(self::DATABASE_NAME);

		if ($values instanceof Criteria) {
			$criteria = clone $values; 
			$comparison = $criteria->getComparison(ReleasePeer::ID);
			$selectCriteria->add(ReleasePeer::ID, $criteria->remove(ReleasePeer::ID), $comparison);

		} else { 			$criteria = $values->buildCriteria(); 			$selectCriteria = $values->buildPkeyCriteria(); 		}

				$criteria->setDbName(self::DATABASE_NAME);

		return BasePeer::doUpdate($selectCriteria, $criteria, $con);
	}

	
	public static function doDeleteAll($con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}
		$affectedRows = 0; 		try {
									$con->begin();
			$affectedRows += BasePeer::doDeleteAll(ReleasePeer::TABLE_NAME, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	 public static function doDelete($values, $con = null)
	 {
		if ($con === null) {
			$con = Propel::getConnection(ReleasePeer::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} elseif ($values instanceof Release) {

			$criteria = $values->buildPkeyCriteria();
		} else {
						$criteria = new Criteria(self::DATABASE_NAME);
			$criteria->add(ReleasePeer::ID, (array) $values, Criteria::IN);
		}

				$criteria->setDbName(self::DATABASE_NAME);

		$affectedRows = 0; 
		try {
									$con->begin();
			
			$affectedRows += BasePeer::doDelete($criteria, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public static function doValidate(Release $obj, $cols = null)
	{
		$columns = array();

		if ($cols) {
			$dbMap = Propel::getDatabaseMap(ReleasePeer::DATABASE_NAME);
			$tableMap = $dbMap->getTable(ReleasePeer::TABLE_NAME);

			if (! is_array($cols)) {
				$cols = array($cols);
			}

			foreach($cols as $colName) {
				if ($tableMap->containsColumn($colName)) {
					$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
					$columns[$colName] = $obj->$get();
				}
			}
		} else {

		}

		$res =  BasePeer::doValidate(ReleasePeer::DATABASE_NAME, ReleasePeer::TABLE_NAME, $columns);
    if ($res !== true) {
        $request = sfContext::getInstance()->getRequest();
        foreach ($res as $failed) {
            $col = ReleasePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
            $request->setError($col, $failed->getMessage());
        }
    }

    return $res;
	}

	
	public static function retrieveByPK($pk, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$criteria = new Criteria(ReleasePeer::DATABASE_NAME);

		$criteria->add(ReleasePeer::ID, $pk);


		$v = ReleasePeer::doSelect($criteria, $con);

		return !empty($v) > 0 ? $v[0] : null;
	}

	
	public static function retrieveByPKs($pks, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$objs = null;
		if (empty($pks)) {
			$objs = array();
		} else {
			$criteria = new Criteria();
			$criteria->add(ReleasePeer::ID, $pks, Criteria::IN);
			$objs = ReleasePeer::doSelect($criteria, $con);
		}
		return $objs;
	}

} 
if (Propel::isInit()) {
			try {
		BaseReleasePeer::getMapBuilder();
	} catch (Exception $e) {
		Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
	}
} else {
			Propel::registerMapBuilder('lib.model.map.ReleaseMapBuilder');
}
